

on clicked theObject
	set botao to name of theObject
	
	if botao is "env1" then
		my dataHoje("env1dia", "env1hora", "provas", "tabObras", "PrePress Ver Obras")
	else if botao is "rec1" then
		my dataHoje("rec1dia", "rec1hora", "provas", "tabObras", "PrePress Ver Obras")
		
		
	end if
	
end clicked




on dataHoje(textFieldDia, textFieldHora, tabViewItem, tabView, mainWindow)
	set ano to year of (current date) as string
	set mes to month of (current date) as integer as string
	set dia to day of (current date) as string
	set hora to hours of (current date) as string
	set minutos to minutes of (current date)
	
	
	if minutos ≤ 9 then
		set minutos to "0" & minutos
	end if
	
	set dataDia to ano & "-" & mes & "-" & dia
	set dataHora to hora & ":" & minutos
	
	set contents of text field textFieldDia of tab view item tabViewItem of tab view tabView of window mainWindow to dataDia
	set contents of text field textFieldHora of tab view item tabViewItem of tab view tabView of window mainWindow to dataHora
end dataHoje



on inserirDataHoraProvas()
	tell user defaults
		set theDatabaseFinal to contents of default entry "theDatabaseFinal"
	end tell
	
	
end inserirDataHoraProvas